home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Movie Clips Screensaver
/
Movie Clips Screen Saver.iso
/
expert.mst
< prev
next >
Wrap
Text File
|
1995-01-25
|
21KB
|
716 lines
'$define debug
'$include 'setupapi.inc'
'$include 'msdetect.inc'
'$INCLUDE 'mscpydis.inc' ''System
''Standard Dialog ID's : Make sure these are consistent with STDCUI.H file.
const WELCOME = 100
const ASKQUIT = 200
const DESTPATH = 300
const EXITQUIT = 600
const EXITSUCCESS = 700
CONST EXITFAILURE = 400
CONST APPHELP = 900
CONST CHECK = 2500
CONST SMALLWIN = 2200
CONST RESTART = 2600
CONST RESTARTII = 2700
''Custom Dialog ID's : Make sure these are consistent with CUIDLG.H file.
const SELECTMODE = 6201
const SELECTCHIP = 6202
const SELECTSIZE = 6203
const TOOBIG = 6204
const SELECTCLIPS = 6205
const SELECTPLAYER = 6206
const NEWEXTWARNING = 6207
const CHOOSECDROM = 6208
'' Error IDs
const ERR_BADVGAMODE = 8000
const ERR_BADCPU = 8001
const ERR_BADWINDOWSPATH = 8002
const ERR_BADPATH = 8003
''Bitmap ID
const LOGO = 6101
''Bitmap ID
CONST VFWLOGO = 1
''Chip sets : Make sure these are consistent with the WhatVga DLL
const CIRRUS = 100
const EVEREX = 101
const PARADISE = 102
const TSENG = 103
const TRIDENT = 104
const T8900 = 105
const ATIVGA = 106
const AHEADA = 107
const AHEADB = 108
const OAKTECH = 109
const VIDEO7 = 110
const CHIPSTECH = 111
const TSENG4 = 112
const GENOA = 113
const NCR = 114
const COMPAQ = 115
const UNKNOWN = -1
''User interface DLL name
const UIDll$ = "cui.dll"
''Constants for functions
''GetProcessor
const IS386 = 3
''GetDeviceCaps
const NUMCOLORS = 24
const SIZEPALETTE = 104
'' Global variable declaration
global ExpertPath$ ''Default destination directory.
global WindowsDir$ ''Windows directory.
global ExpertIniPath$ ''Path to the INI file to be used
GLOBAL SizeReq& '' Total Disk Size required for installation
''File Types
GLOBAL WinDir$
GLOBAL WinSysDir$
GLOBAL WinSys32Dir$
GLOBAL WINDRIVE$ ''Windows Drive Letter.
GLOBAL CHECKSTATES$
GLOBAL MinorVer%
GLOBAL OnNT$
'' functions/procedure declaration
declare sub ConfirmQuit
declare function MakePath (szDir$, szFile$) as string
declare function GetColors() as integer
DECLARE SUB VFW_Install
DECLARE SUB VFW_Init
'' External function/procedure declaration
DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
DECLARE SUB Reboot LIB "iniupd.dll"
DECLARE fUNCTION ExitWindowsExec LIB "User" (Exec$, Param$) AS INTEGER
declare function GetDC lib "USER.EXE" (hwnd%) as integer
declare function ReleaseDC lib "USER.EXE" (hwnd%, hdc%) as integer
declare function GetDeviceCaps lib "GDI.EXE" (hdc%, iCapabilities%) as integer
Init: '' Start here
'' Set up the error traps
on error goto HandleError
'' Set up the way the install program looks
SetBitmap UIDll$, LOGO
SetTitle "Expert Movie Clips Screen Saver Setup"
'' Make sure proper hardware is there
if GetProcessorType() < IS386 then
'' We aren't on a 386 or above. FATAL!
error ERR_BADCPU
end if
i% = GetColors()
if i% <= 16 then
'' make sure we didn't just wrap around...
if i% >= 0 then
'' We don't have a VGA driver with 256 colors
'' installed. FATAL!
error ERR_BADVGAMODE
end if
end if
'' Find the INF file
szInfPath$ = GetSymbolValue("STF_SRCINFPATH")
if szInfPath$ = "" then
'' No predefined path for INF file, so just assume it is in
'' the current directory.
szInfPath$ = GetSymbolValue("STF_CWDDIR") + "EXPERT.INF"
end if
'' Load in the INF file
ReadInfFile szInfPath$
'' Set the size checking mode
i% = SetSizeCheckMode(scmOnIgnore)
'' Check that windows diectory is writable
WindowsDir$ = GetWindowsDir()
i% = IsDirWritable(WindowsDir$)
if i% = 0 then
'' Error: can't write to windows directory. exit.
error ERR_BADWINDOWSPATH
endif
'' setup the ini path
ExpertIniPath$ = MakePath(WindowsDir$, "CONTROL.INI")
DOWELCOME:
sz$ = UIStartDlg(UIDll$, WELCOME, "FInfoDlgProc", 0, "")
if sz$ = "CONTINUE" then
UIPop 1
else
ConfirmQuit
goto DOWELCOME
end if
'' Do the main thing
GETPATH:
'' Set up symbols as parameters for dialog box
if mid$(WindowsDir$, 2, 1) = ":" then
DefExpertPath$ = mid$(WindowsDir$, 1, 2) + "\XMOVIE"
else
DefExpertPath$ = "C:\XMOVIE"
end if
SetSymbolValue "EditTextIn", DefExpertPath$
SetSymbolValue "EditFocus", "ALL"
GETPATHL1:
sz$ = UIStartDlg(UIDll$, DESTPATH, "FEditDlgProc", 0, "")
ExpertPath$ = GetSymbolValue("EditTextOut")
if sz$ = "CONTINUE" then
'' Make sure our target is writable
if IsDirWritable(ExpertPath$) = 0 then
error ERR_BADPATH
'' will resume here
err = 0
goto GETPATHL1
end if
UIPop 1
elseif sz$ = "REACTIVATE" then
goto GETPATHL1
else
ConfirmQuit
goto GETPATH
end if
SrcDir$ = GetSymbolValue("STF_SRCDIR")
CreateDir ExpertPath$, cmoNone
'' Determine the speed of the machine. For the moment ignore this and
'' just use default for rate and simple size selection
'' default for speed
Rate$ = "30"
'' select the size of the player
Size$ = "320"
Small$ = "0"
STARTCOPYING:
'' Add standard files to the copy list
AddSectionFilesToCopyList "Expert", SrcDir$, ExpertPath$
AddSectionFilesToCopyList "Background", SrcDir$, MakePath(ExpertPath$, "backgrnd")
AddSectionFilesToCopyList "Windows", SrcDir$, WindowsDir$
'' Determine if there is enough disk space for the installation.
'' DiskSp& will be > 0 if there is NOT enough space. It will be 0 if there
'' is sufficient free disk space for the installation
SpaceCost& = GetCopyListCost(szExtra$,szCosts$, szNeeded$)
'' Tell user how much more space is needed.
if (SpaceCost& > 0) then
SpaceCostKB% = SpaceCost& / 1000
sz$ = str$(SpaceCostKB%)
SetSymbolValue "SpaceNeeded", sz$
sz$ = UIStartDlg(UIDll$, TOOBIG, "FTooBigDlgProc", 0, "")
UIPop 1
error STFQUIT
endif
'' Copy the files
CopyFilesInCopyList
'' Set up the ini file
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "MoviePath", ExpertPath$, cmoOverwrite
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "CDROMPath", SrcDir, cmoOverwrite
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "ReelPath", MakePath(ExpertPath$, "movies.lst"), cmoOverwrite
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Rate", Rate$, cmoOverwrite
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Small", Small$, cmoOverwrite
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Playtype", "1", cmoOverwrite
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "PreferredExt", ".avi", cmoOverwrite
'' Specify the default backdrop as TV. 0=theater;1=TV;2=newspaper
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Background", "1", cmoOverwrite
'' Set up the backdrop files
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Bitmap0", MakePath(ExpertPath$, "backgrnd\closeup.dib") + ",160,77", cmoOverwrite
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Bitmap1", MakePath(ExpertPath$, "backgrnd\bigtv.dib") + ",178,178", cmoOverwrite
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Bitmap2", MakePath(ExpertPath$, "backgrnd\bigpaper.dib") + ",147,129", cmoOverwrite
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "BackgroundX", "178", cmoOverwrite
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "BackgroundY", "178", cmoOverwrite
'' Add NULL/default values for other INI file keys
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "Tiled", "0", cmoOverwrite
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "BackgroundPath", "", cmoOverwrite
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "History0", "", cmoOverwrite
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "History1", "", cmoOverwrite
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "History2", "", cmoOverwrite
CreateIniKeyValue ExpertIniPath$, "Screen Saver.Expert", "History3", "", cmoOverwrite
C